#ifndef COMPLEXCHROMOSOME_H_
#define COMPLEXCHROMOSOME_H_

#include <QList>

#include "Chromosome.h"


/**
  * @author Łukasz Szybka
  */
template<class T>
class ComplexChromosome : public Chromosome
{
public:
    ComplexChromosome();
    ComplexChromosome(int size);
    /**
      * Constructor
      * @param size Lenght of chromosome
      */
    ComplexChromosome(int size, T min, T max);
    ComplexChromosome(T min, T max);
    /**
      * Copy constructor
      * @param other ComplexChromosome to copy
      */
    ComplexChromosome(const ComplexChromosome &other);
    /**
      * Destructor
      */
    virtual ~ComplexChromosome();

    virtual void setRandom();
    virtual void crossOver(const Chromosome& partner);
    virtual void mutate(int index);

    virtual bool operator==(const Chromosome& other) const;

    virtual QVariant at(int index) const;
    virtual QVariant data() const;
    virtual int size() const;

protected:
    virtual T getRandomValue() const = 0;

    QList<T> geneArray;
    T minValue;
    T maxValue;
private:

};

#include "ComplexChromosome.cpp"

#endif /*COMPLEXCHROMOSOME_H_*/
